<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template basic_managed_heap_memory</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.managed__heap__memory_8hpp" title="Header &lt;boost/interprocess/managed_heap_memory.hpp&gt;">
<link rel="prev" href="managed__external__buffer_8hpp_1a44bcef480cc2f8cfca738e1fc1cfeb94.html" title="Type definition wmanaged_external_buffer">
<link rel="next" href="managed__heap__memory_8hpp_1ad848dfe9b9f24d012e3cef54e45b0fab.html" title="Type definition managed_heap_memory">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="managed__external__buffer_8hpp_1a44bcef480cc2f8cfca738e1fc1cfeb94.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.managed__heap__memory_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="managed__heap__memory_8hpp_1ad848dfe9b9f24d012e3cef54e45b0fab.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template basic_managed_heap_memory</span></h2>
<p>boost::interprocess::basic_managed_heap_memory</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.managed__heap__memory_8hpp" title="Header &lt;boost/interprocess/managed_heap_memory.hpp&gt;">boost/interprocess/managed_heap_memory.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharType<span class="special">,</span> <span class="keyword">typename</span> AllocationAlgorithm<span class="special">,</span> 
         <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">IndexConfig</span> <span class="special">&gt;</span> <span class="keyword">class</span> IndexType<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html" title="Class template basic_managed_heap_memory">basic_managed_heap_memory</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">base_t</span><span class="special">::</span><span class="identifier">size_type</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a8744ca9768aff7d1587a957877737299"></a><span class="identifier">size_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html#id34-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a5bc9eae20bee3aee52cce3253a365206"><span class="identifier">basic_managed_heap_memory</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a10f38acf039200d62ca4b18c9b00c04f"><span class="special">~</span><span class="identifier">basic_managed_heap_memory</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a7f61242814305f6fcc494d6ef406eff3"><span class="identifier">basic_managed_heap_memory</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a26ed9b94cd0ea689cb77823d75fb4360"><span class="identifier">basic_managed_heap_memory</span></a><span class="special">(</span><a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html" title="Class template basic_managed_heap_memory">basic_managed_heap_memory</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html" title="Class template basic_managed_heap_memory">basic_managed_heap_memory</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1ab99eb263b1eb985d3c45e0e7482bfd18"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html" title="Class template basic_managed_heap_memory">basic_managed_heap_memory</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a4b9164f997bd7650d379a2a289bcdc27"><span class="identifier">grow</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a3dbc4ef4338e47365ce92a0c2672b15e"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html" title="Class template basic_managed_heap_memory">basic_managed_heap_memory</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.16.19.3.35.4.4"></a><h2>Description</h2>
<p>A basic heap memory named object creation class. Initializes the heap memory segment. Inherits all basic functionality from basic_managed_memory_impl&lt;CharType, AllocationAlgorithm, IndexType&gt;*<span style="color: red">&lt;zwj&gt;&lt;/zwj&gt;</span>/ </p>
<div class="refsect2">
<a name="id-1.3.16.19.3.35.4.4.3"></a><h3>
<a name="id34-bb"></a><code class="computeroutput">basic_managed_heap_memory</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a5bc9eae20bee3aee52cce3253a365206"></a><span class="identifier">basic_managed_heap_memory</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Default constructor. Does nothing. Useful in combination with move semantics </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a10f38acf039200d62ca4b18c9b00c04f"></a><span class="special">~</span><span class="identifier">basic_managed_heap_memory</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Destructor. Liberates the heap memory holding the managed data. Never throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a7f61242814305f6fcc494d6ef406eff3"></a><span class="identifier">basic_managed_heap_memory</span><span class="special">(</span><span class="identifier">size_type</span> size<span class="special">)</span><span class="special">;</span></pre>
<p>Creates heap memory and initializes the segment manager. This can throw. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a26ed9b94cd0ea689cb77823d75fb4360"></a><span class="identifier">basic_managed_heap_memory</span><span class="special">(</span><a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html" title="Class template basic_managed_heap_memory">basic_managed_heap_memory</a> <span class="special">&amp;&amp;</span> moved<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Moves the ownership of "moved"'s managed memory to *this. Does not throw. </li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html" title="Class template basic_managed_heap_memory">basic_managed_heap_memory</a> <span class="special">&amp;</span> 
<a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1ab99eb263b1eb985d3c45e0e7482bfd18"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html" title="Class template basic_managed_heap_memory">basic_managed_heap_memory</a> <span class="special">&amp;&amp;</span> moved<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Moves the ownership of "moved"'s managed memory to *this. Does not throw. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a4b9164f997bd7650d379a2a289bcdc27"></a><span class="identifier">grow</span><span class="special">(</span><span class="identifier">size_type</span> extra_bytes<span class="special">)</span><span class="special">;</span></pre>
<p>Tries to resize internal heap memory so that we have room for more objects. WARNING: If memory is reallocated, all the objects will be binary-copied to the new buffer. To be able to use this function, all pointers constructed in this buffer must be offset pointers. Otherwise, the result is undefined. Returns true if the growth has been successful, so you will have some extra bytes to allocate new objects. If returns false, the heap allocation has failed. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__managed__heap__memory_1a3dbc4ef4338e47365ce92a0c2672b15e"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="classboost_1_1interprocess_1_1basic__managed__heap__memory.html" title="Class template basic_managed_heap_memory">basic_managed_heap_memory</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Swaps the ownership of the managed heap memories managed by *this and other. Never throws. </p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2005-2024 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="managed__external__buffer_8hpp_1a44bcef480cc2f8cfca738e1fc1cfeb94.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.managed__heap__memory_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="managed__heap__memory_8hpp_1ad848dfe9b9f24d012e3cef54e45b0fab.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
